/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package controller.action;

import model.database.SqlCategory;
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import model.entities.Category;

/**
 *
 * @author HoangTien
 */
public class IndexAction implements Action{ 
    public void exe(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        SqlCategory sc = new SqlCategory();
        List<Category> listCate = sc.getListCategories(); 
        HttpSession session = request.getSession();
        session.setAttribute("Categories", listCate);
        request.getRequestDispatcher("/index.jsp").forward(request, response);
    }
    
}
